<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>权限列表</title>

<script src="../static/jquery/jquery-1.8.3.min.js" type="text/javascript"></script>
<link href="../static/bootstrap/2.3.1/css/bootstrap.min.css" type="text/css" rel="stylesheet" />
<script src="../static/bootstrap/2.3.1/js/bootstrap.min.js" type="text/javascript"></script>
<!--[if lte IE 6]>
<link href="static/bootstrap/bsie/css/bootstrap-ie6.min.css" type="text/css" rel="stylesheet" />
<script src="static/bootstrap/bsie/js/bootstrap-ie.min.js" type="text/javascript"></script>
<![endif]-->
<link href="../static/jquery-select2/3.4/select2.min.css" rel="stylesheet" />
<script src="../static/jquery-select2/3.4/select2.min.js" type="text/javascript"></script>
<link href="../static/jquery-validation/1.11.0/jquery.validate.min.css" type="text/css" rel="stylesheet" />
<script src="../static/jquery-validation/1.11.0/jquery.validate.min.js" type="text/javascript"></script>
<link href="../static/jquery-jbox/2.3/Skins/Bootstrap/jbox.min.css" rel="stylesheet" />
<script src="../static/jquery-jbox/2.3/jquery.jBox-2.3.min.js" type="text/javascript"></script>
<script src="../static/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
<link href="../static/common/common.css" type="text/css" rel="stylesheet" />
<script src="../static/common/common.js" type="text/javascript"></script>
 <link href="../static/treeTable/themes/vsStyle/treeTable.min.css" rel="stylesheet" type="text/css" />
<script src="../static/treeTable/jquery.treeTable.min.js" type="text/javascript"></script> 
<!--  <script type="text/javascript">
		$(function() {
			$("#treeTable").treeTable({
				expandLevel : 3,//展开级数
				clickableNodeNames:true
				
			
			}).show();
			
		});
    	/* function updateSort() {
			loading('正在提交，请稍等...');
	    	$("#listForm").attr("action", "#");
	    	$("#listForm").submit();
    	} */
	</script>  -->


<script type="text/javascript" src="../static/plugin/zTree_v3/js/jquery-1.4.4.min.js"></script>
<link rel="stylesheet" type="text/css" href="../static/plugin/zTree_v3/css/zTreeStyle/zTreeStyle.css">
<script type="text/javascript" src="../static/plugin/zTree_v3/js/jquery.ztree.all.min.js"></script>

</head>
<body>
<%-- ${menuList}
<ul class="nav nav-tabs">
		<li class="active"><a href="menuList.html">菜单列表</a></li>
		<li><a href="menuAdd.html">菜单添加</a></li>
	</ul>
	
<script type="text/javascript">top.$.jBox.closeTip();</script>

	<form id="listForm" method="post">
		<table id="treeTable" class="table table-striped table-bordered table-condensed hide">
			<thead><tr><th>名称</th><th>链接</th><th style="text-align:center;">排序</th><th>可见</th><th>权限标识</th><th>操作</th></tr></thead>
			<tbody>
				<tr id="27" pId="0">
					<td nowrap><i class="icon- hide"></i><a href="#">我的面板</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="27"/>
							<input name="sorts" type="text" value="10" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="28" pId="27">
					<td nowrap><i class="icon- hide"></i><a href="#">个人信息</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="28"/>
							<input name="sorts" type="text" value="10" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="29" pId="28">
					<td nowrap><i class="icon-user"></i><a href="#">个人信息</a></td>
					<td title="/sys/user/info">/sys/user/info</td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="29"/>
							<input name="sorts" type="text" value="20" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="30" pId="28">
					<td nowrap><i class="icon-lock"></i><a href="#">修改密码</a></td>
					<td title="/sys/user/changePwd">/sys/user/changePwd</td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="30"/>
							<input name="sorts" type="text" value="30" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="2" pId="0">
					<td nowrap><i class="icon- hide"></i><a href="#">系统设置</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="2"/>
							<input name="sorts" type="text" value="20" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="13" pId="2">
					<td nowrap><i class="icon- hide"></i><a href="#">机构用户</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="13"/>
							<input name="sorts" type="text" value="10" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="20" pId="13">
					<td nowrap><i class="icon-user"></i><a href="#">用户管理</a></td>
					<td title="/sys/user/index">/sys/user/index</td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="20"/>
							<input name="sorts" type="text" value="10" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="21" pId="20">
					<td nowrap><i class="icon- hide"></i><a href="#">查看</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="21"/>
							<input name="sorts" type="text" value="30" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>隐藏</td>
					<td title="sys:user:view">sys:user:view</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="22" pId="20">
					<td nowrap><i class="icon- hide"></i><a href="#">修改</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="22"/>
							<input name="sorts" type="text" value="40" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>隐藏</td>
					<td title="sys:user:edit">sys:user:edit</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="17" pId="13">
					<td nowrap><i class="icon-th-large"></i><a href="#">机构管理</a></td>
					<td title="/sys/office/">/sys/office/</td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="17"/>
							<input name="sorts" type="text" value="20" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="18" pId="17">
					<td nowrap><i class="icon- hide"></i><a href="#">查看</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="18"/>
							<input name="sorts" type="text" value="30" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>隐藏</td>
					<td title="sys:office:view">sys:office:view</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="19" pId="17">
					<td nowrap><i class="icon- hide"></i><a href="#">修改</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="19"/>
							<input name="sorts" type="text" value="40" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>隐藏</td>
					<td title="sys:office:edit">sys:office:edit</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="14" pId="13">
					<td nowrap><i class="icon-th"></i><a href="#">区域管理</a></td>
					<td title="/sys/area/">/sys/area/</td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="14"/>
							<input name="sorts" type="text" value="30" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="15" pId="14">
					<td nowrap><i class="icon- hide"></i><a href="#">查看</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="15"/>
							<input name="sorts" type="text" value="30" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>隐藏</td>
					<td title="sys:area:view">sys:area:view</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="16" pId="14">
					<td nowrap><i class="icon- hide"></i><a href="#">修改</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="16"/>
							<input name="sorts" type="text" value="40" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>隐藏</td>
					<td title="sys:area:edit">sys:area:edit</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="3" pId="2">
					<td nowrap><i class="icon- hide"></i><a href="#">系统设置</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="3"/>
							<input name="sorts" type="text" value="20" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="4" pId="3">
					<td nowrap><i class="icon-list-alt"></i><a href="#">菜单管理</a></td>
					<td title="/sys/menu/">/sys/menu/</td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="4"/>
							<input name="sorts" type="text" value="10" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="5" pId="4">
					<td nowrap><i class="icon- hide"></i><a href="#">查看</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="5"/>
							<input name="sorts" type="text" value="30" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>隐藏</td>
					<td title="sys:menu:view">sys:menu:view</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="6" pId="4">
					<td nowrap><i class="icon- hide"></i><a href="#">修改</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="6"/>
							<input name="sorts" type="text" value="40" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>隐藏</td>
					<td title="sys:menu:edit">sys:menu:edit</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="7" pId="3">
					<td nowrap><i class="icon-lock"></i><a href="#">角色管理</a></td>
					<td title="/sys/role/">/sys/role/</td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="7"/>
							<input name="sorts" type="text" value="20" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="8" pId="7">
					<td nowrap><i class="icon- hide"></i><a href="#">查看</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="8"/>
							<input name="sorts" type="text" value="30" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>隐藏</td>
					<td title="sys:role:view">sys:role:view</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="9" pId="7">
					<td nowrap><i class="icon- hide"></i><a href="#">修改</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="9"/>
							<input name="sorts" type="text" value="40" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>隐藏</td>
					<td title="sys:role:edit">sys:role:edit</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="10" pId="3">
					<td nowrap><i class="icon-th-list"></i><a href="#">字典管理</a></td>
					<td title="/sys/dict/">/sys/dict/</td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="10"/>
							<input name="sorts" type="text" value="30" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="11" pId="10">
					<td nowrap><i class="icon- hide"></i><a href="#">查看</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="11"/>
							<input name="sorts" type="text" value="30" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>隐藏</td>
					<td title="sys:dict:view">sys:dict:view</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="12" pId="10">
					<td nowrap><i class="icon- hide"></i><a href="#">修改</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="12"/>
							<input name="sorts" type="text" value="40" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>隐藏</td>
					<td title="sys:dict:edit">sys:dict:edit</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="67" pId="2">
					<td nowrap><i class="icon- hide"></i><a href="#">日志查询</a></td>
					<td title=""></td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="67"/>
							<input name="sorts" type="text" value="30" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="68" pId="67">
					<td nowrap><i class="icon-pencil"></i><a href="#">日志查询</a></td>
					<td title="/sys/log">/sys/log</td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="68"/>
							<input name="sorts" type="text" value="10" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title="sys:log:view">sys:log:view</td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			
				<tr id="84" pId="67">
					<td nowrap><i class="icon- hide"></i><a href="#">连接池监视</a></td>
					<td title="/../druid">/../druid</td>
					<td style="text-align:center;">
						
							<input type="hidden" name="ids" value="84"/>
							<input name="sorts" type="text" value="20" style="width:50px;margin:0;padding:0;text-align:center;">
						
					</td>
					<td>显示</td>
					<td title=""></td>
					<td nowrap>
						<a href="menuAdd.html">修改</a>
						<a href="#" onclick="return confirmx('要删除该菜单及所有子菜单项吗？', this.href)">删除</a>
						<a href="menuAdd.html">添加下级菜单</a>
					</td>
				</tr>
			</tbody>
		</table>
		<div class="form-actions pagination-left">
			<input id="btnSubmit" class="btn btn-primary" type="button" value="保存排序" onclick="updateSort();"/>
		</div>
	 </form>
 --%>











		
<script type="text/javascript">
$(document).ready(function(){
	
	$("form").submit(function(e){
		/* 	var ids = [], nodes = tree.getCheckedNodes(true);
			for(var i=0; i<nodes.length; i++) {
				ids.push(nodes[i].id);
			}
			$("#menuIds").val(ids);
			loading('正在提交，请稍等...'); */
			form.submit();
		})
	

	var setting = {
		    /* "check": {
		        "enable": true,
		        "nocheckInherit": true
		    }, */
		    "view": {
		        "selectedMulti": false
		    },
		    "data": {
		        "simpleData": {
		            "enable": true
		        }
		    },
		    "callback": {
		    	/* beforeClick: zTreeBeforeClick, */
		    	onClick: zTreeOnClick
		    }
		};
	
	// 用户-菜单
	
	var zNodes= eval('${menuList}');
	// 初始化树结构
	var tree = $.fn.zTree.init($("#menuTree"), setting, zNodes);
	// 不选择父节点
	tree.setting.check.chkboxType = { "Y" : "ps", "N" : "s" };
	setInterval(()=>{
		var treeObj = tree.getCheckedNodes();
		//var nodes = treeObj.getCheckedNodes(true);
		console.log(treeObj);
	},2000); 
	// 默认选择节点
	var ids = "".split(",");
	for(var i=0; i<ids.length; i++) {
		var node = tree.getNodeByParam("id", ids[i]);
		try{tree.checkNode(node, true, false);}catch(e){}
	}
	// 默认展开全部节点
	tree.expandAll(true);
	
	//禁止beixuanzhg
	/* function zTreeBeforeClick(treeId, treeNode, clickFlag) {
	    return true;
	}; */
	function zTreeOnClick(event, treeId, zNodes) {
		var Mname = zNodes.name;
		var Mid = zNodes.id;
		$("#lastMenu").val(Mname);
		$("#lastId").val(Mid);
	    alert(Mid + ", " + Mname);
	    
	};
	
	// 用户-机构
	/* var zNodes = eval('${menuList}') */
	/* var zNodes2=[
			{id:"1", pId:"0", name:"湖南省总公司"},
            {id:"2", pId:"1", name:"公司领导"},
            {id:"3", pId:"1", name:"综合部"},
            {id:"4", pId:"1", name:"市场部"},
            {id:"5", pId:"1", name:"技术部"},
            {id:"6", pId:"1", name:"研发部"},
            {id:"7", pId:"1", name:"长沙市分公司"},
            {id:"8", pId:"7", name:"公司领导"},
            {id:"9", pId:"7", name:"综合部"},
            {id:"10", pId:"7", name:"市场部"},
            {id:"11", pId:"7", name:"技术部"},
            {id:"12", pId:"7", name:"芙蓉区分公司"},
            {id:"13", pId:"12", name:"公司领导"},
            {id:"14", pId:"12", name:"综合部"},
            {id:"15", pId:"12", name:"市场部"},
            {id:"16", pId:"12", name:"技术部"},
            ]; */
	
})
/* var treeObj = $.fn.zTree.getZTreeObj("tree");
var nodes = treeObj.getCheckedNodes(true);
console.log(nodes); */
/* var checkedObjs = tree.getCheckedNodes(true);  //获取所有选中的节点
    if(checkedObjs.length!=3){
        layer.alert("必须选择3个产品");
        flag=false;
        return;
    } */
   


</script>
<div id="menuTree" class="ztree" style="margin-top:3px;float:left;"></div>
				<input id="menuIds" name="menuIds" type="hidden" value=""/>

 <form id="form" class="form-horizontal" action="${pageContext.request.contextPath}/sys/menu.do?method=addMenu&tgId=${tgId}&pageNum=1" method="post">
		
<script type="text/javascript">top.$.jBox.closeTip();</script>

	
		
		
		
		<div class="control-group">
			<label class="control-label">添加权限</label>
			<div class="controls">
				<div id="menuTree" class="ztree" style="margin-top:3px;float:left;"></div>
				<input id="menuIds" name="menuIds" type="hidden" value=""/>
				上一级菜单:<input  id ="lastMenu"type = "text" name="UPmenuName"><br>
				<input id="lastId" type = "hidden" name="menuPid" value="">
				
				权限名称：<input type = "text" name = "menuName"><br>
				权限路径：<input type = "text" name = "menuUrl"><br>
				<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
			</div>
		</div>
		
		<div class="form-actions">
			
				
			
			
		</div>
	</form> 






</body>
</html>



















